local skel = fk.CreateSkill {
  name = "rmt__zhundeng",
  tags = {Skill.Lord},
}

Fk:loadTranslationTable{
  ["rmt__zhundeng"] = "谆登",
  [":rmt__zhundeng"] = "主公技，其他角色回复体力后，其可以令你重铸一张牌，若为宋势力角色，改为摸一张牌。",

  ["#rmt__zhundeng-recast"] = "谆登：你可以令 %src 重铸一张牌",
  ["#rmt__zhundeng-draw"] = "谆登：你可以令 %src 摸一张牌",
  ["#rmt__zhundeng-card"] = "谆登：请重铸一张牌",

  ["$rmt__zhundeng1"] = "天视自我民视，天听自我民听。",
  ["$rmt__zhundeng2"] = "之中国、践大宝；天与之，人与之！",
}

skel:addEffect(fk.HpRecover, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target ~= player and (target.kingdom == "song" or not player:isNude())
  end,
  on_cost = function (self, event, target, player, data)
    if player.room:askToSkillInvoke(target, {
      skill_name = skel.name, prompt = "#rmt__zhundeng-"..(target.kingdom == "song" and "draw:" or "recast:")..player.id
    }) then
      event:setCostData(self,  {tos = {player}})
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    if target.kingdom == "song" then
      player:drawCards(1, self.name)
    elseif not player:isNude() then
      local cards = room:askToCards(player, {
        min_num = 1, max_num = 1, include_equip = true,
        skill_name = self.name, cancelable = false, prompt = "#rmt__zhundeng-card"
      })
      room:recastCard(cards, player, self.name)
    end
  end,
})


return skel
